home *** CD-ROM | disk | FTP | other *** search
- on indexUpArrowAction
- global indexWindowObject
- indexScrollButtons(the upArrowSprite of indexWindowObject, -1)
- end
-
- on indexDownArrowAction
- global indexWindowObject
- indexScrollButtons(the downArrowSprite of indexWindowObject, 1)
- end
-
- on indexScrollButtons whichSprite, whichDirection
- set the castNum of sprite whichSprite to the castNum of sprite whichSprite + 1
- updateStage()
- set buttonDown to 1
- indexScrollWindow(whichDirection)
- set startRect to the rect of sprite whichSprite
- repeat while the mouseDown
- set nextPoint to point(the mouseH, the mouseV)
- if inside(nextPoint, startRect) then
- if not buttonDown then
- set buttonDown to 1
- set the castNum of sprite whichSprite to the castNum of sprite whichSprite + 1
- updateStage()
- end if
- indexScrollWindow(whichDirection)
- next repeat
- end if
- if buttonDown then
- set buttonDown to 0
- set the castNum of sprite whichSprite to the castNum of sprite whichSprite - 1
- updateStage()
- end if
- end repeat
- if buttonDown then
- set buttonDown to 0
- set the castNum of sprite whichSprite to the castNum of sprite whichSprite - 1
- updateStage()
- end if
- end
-
- on indexSliderAction
- global indexWindowObject
- set sliderSprite to the sliderSprite of indexWindowObject
- set barRect to the barRect of indexWindowObject
- set myTolerance to 0
- puppetSprite(sliderSprite, 1)
- set sliderHeight to the height of sprite sliderSprite
- set mouseMinH to the left of sprite sliderSprite - myTolerance
- set mouseMaxH to the right of sprite sliderSprite + myTolerance
- set mouseMinV to getAt(barRect, 2)
- set mouseMaxV to getAt(barRect, 4)
- set sliderMinV to mouseMinV + (sliderHeight / 2)
- set sliderMaxV to mouseMaxV - (sliderHeight / 2) - 1
- set sliderRange to sliderMaxV - sliderMinV
- set startSliderTop to the top of sprite sliderSprite - mouseMinV - 1
- set currentSliderV to the locV of sprite sliderSprite
- set previousSliderTop to startSliderTop
- repeat while the mouseDown
- set currentH to the mouseH
- set currentV to the mouseV
- if (currentH >= mouseMinH) and (currentH <= mouseMaxH) then
- if (currentV >= sliderMinV) and (currentV <= sliderMaxV) then
- set nextLocV to currentV
- else
- if (currentV >= mouseMinV) and (currentV <= sliderMinV) then
- set nextLocV to sliderMinV
- else
- if (currentV >= sliderMaxV) and (currentV <= mouseMaxV) then
- set nextLocV to sliderMaxV
- else
- set nextLocV to currentSliderV
- end if
- end if
- end if
- else
- set nextLocV to currentSliderV
- end if
- set the locV of sprite sliderSprite to nextLocV
- updateStage()
- set currentSliderTop to nextLocV - sliderMinV - 1
- if currentSliderTop <> previousSliderTop then
- set fractionalDist to float(currentSliderTop) / sliderRange
- indexScrollWindow(fractionalDist, 1)
- set previousSliderTop to currentSliderTop
- updateStage()
- end if
- end repeat
- end
-
- on indexBarAction
- global indexWindowObject
- set firstTime to 1
- set currentV to the mouseV
- set barSprite to the buttonSprite of indexWindowObject
- set sliderSprite to the sliderSprite of indexWindowObject
- set barRect to the barRect of indexWindowObject
- set myTolerance to 0
- set minV to getAt(barRect, 2)
- set maxV to getAt(barRect, 4)
- set sliderTop to the top of sprite sliderSprite
- set sliderHeight to the height of sprite sliderSprite
- if currentV < (sliderTop + (sliderHeight / 2)) then
- set whichDirection to -1
- else
- set whichDirection to 1
- end if
- repeat while the mouseDown or firstTime
- set sliderTop to the top of sprite sliderSprite
- if inside(point(the mouseH, the mouseV), barRect) then
- if (currentV < sliderTop) and (whichDirection = -1) then
- indexScrollWindow("pageUp")
- else
- if (currentV > (sliderTop + sliderHeight)) and (whichDirection = 1) then
- indexScrollWindow("pageDown")
- end if
- end if
- set currentV to the mouseV
- end if
- set firstTime to 0
- end repeat
- end
-
- on indexTextAction
- global indexWindowObject, gButCalled, gIndexLine, gIndexTop
- set textField to the textName of indexWindowObject
- set newLine to the mouseLine
- if (newLine <= 0) or (newLine > the number of lines in field textField) then
- return
- end if
- if length(line newLine of field textField) <= 1 then
- return
- end if
- hilite line newLine of field textField
- setupLinkButtons(indexWindowObject, newLine)
- set gButCalled to 1
- set gIndexLine to newLine
- set gIndexTop to the scrollTop of member the textName of indexWindowObject
- end
-
- on indexGotoAction
- global indexWindowObject, gReturnMovie
- set theLine to the currentLine of indexWindowObject
- set theField to the textName of indexWindowObject
- if theLine <= 0 then
- return
- end if
- set theText to line theLine of field theField
- set movieName to indexGetFileName(theText)
- puppetSound(0)
- updateStage()
- tell the stage
- gomovie(movieName)
- end tell
- end
-
- on indexGoAction whichOne
- global indexWindowObject
- indGoAction(indexWindowObject, whichOne)
- end
-